package books4africa



import grails.test.mixin.*
import org.junit.*

/**
 * See the API for {@link grails.test.mixin.domain.DomainClassUnitTestMixin} for usage instructions
 */
@TestFor(Donor)
class DonorTests {

    void testUsername(){
		//evaluate email addresses based on the regex
		Donor testDonor1 = new Donor(username:"hullabaloo!gmail.net", password: "password",
			listOfCategories: null)
		Donor testDonor2 = new Donor(username:"hullabaloo@gmail.net", password: "password",
			listOfCategories: null)
		
		assertFalse(testDonor1.validate())
		assertTrue(testDonor2.validate())
	}
}
